//
//  SKTHomeTopView.m
//  SKTDemo
//
//  Created by Ashlike on 28/04/2018.
//  Copyright © 2018 cy55. All rights reserved.
//

#import "SKTHomeTopView.h"
@interface SKTHomeTopView()
@property (weak, nonatomic) IBOutlet UITextField *topTextField;
@property (weak, nonatomic) IBOutlet UITextField *leftTextField;
@property (weak, nonatomic) IBOutlet UITextField *bottomTextField;
@property (weak, nonatomic) IBOutlet UITextField *littlTextField;

@end
@implementation SKTHomeTopView
- (void)addTargetMethod {
    [self.topTextField addTarget:self action:@selector(topTextFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
    [self.leftTextField addTarget:self action:@selector(leftTextFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
    [self.bottomTextField addTarget:self action:@selector(bottomTextFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
    [self.littlTextField addTarget:self action:@selector(littlTextFieldTextChange:) forControlEvents:UIControlEventEditingChanged];

}

-(void)topTextFieldTextChange:(UITextField *)textField{
    NSLog(@"topTextFieldTextChange -: %@",textField.text);
    if (self.topTextBlock) {
        self.topTextBlock(textField.text);
    }
}

-(void)leftTextFieldTextChange:(UITextField *)textField{
    NSLog(@"leftTextFieldTextChange -: %@",textField.text);
    if (self.leftTextBlock) {
        self.leftTextBlock(textField.text);
    }
}

-(void)bottomTextFieldTextChange:(UITextField *)textField{
    NSLog(@"bottomTextFieldTextChange -: %@",textField.text);
    if (self.bottomTextBlock) {
        self.bottomTextBlock(textField.text);
    }
}

-(void)littlTextFieldTextChange:(UITextField *)textField{
    NSLog(@"littlTextFieldTextChange -: %@",textField.text);
    if (self.littlextBlock) {
        self.littlextBlock(textField.text);
    }
}

@end
